package org.ext.loader.ogre
{
	import flash.display3D.Context3DVertexBufferFormat;

	/**
	 * 顶点数据格式
	 */
	internal class VertexElementType
	{
		static public const VET_FLOAT1:uint = 0;
		static public const VET_FLOAT2:uint = 1;
		static public const VET_FLOAT3:uint = 2;
		static public const VET_FLOAT4:uint = 3;
		/// alias to more specific colour type - use the current rendersystem's colour packing
		static public const VET_COLOUR:uint = 4;
		static public const VET_SHORT1:uint = 5;
		static public const VET_SHORT2:uint = 6;
		static public const VET_SHORT3:uint = 7;
		static public const VET_SHORT4:uint = 8;
		static public const VET_UBYTE4:uint = 9;
		/// D3D style compact colour
		static public const VET_COLOUR_ARGB:uint = 10;
		/// GL style compact colour
		static public const VET_COLOUR_ABGR:uint = 11;
		
		
		/**
		 * 转换为 molehill 顶点格式
		 */
		static public function toMolehillFormat( ele_type:int ):String{
			switch( ele_type ){
				case VET_FLOAT1:
					return Context3DVertexBufferFormat.FLOAT_1;
				case VET_FLOAT2:
					return Context3DVertexBufferFormat.FLOAT_2;
				case VET_FLOAT3:
					return Context3DVertexBufferFormat.FLOAT_3;
				case VET_FLOAT4:
					return Context3DVertexBufferFormat.FLOAT_4;
				default:
					return null;
			}
		}
			
	}
}